package com.fjnu.entity;

import java.util.Date;

/**
 * 角色权限关联实体类
 */
public class RolePermission {
    private Integer id;
    private String roleId;
    private String permissionId;
    private Date createTime;

    // 空构造方法
    public RolePermission() {}

    // 带参构造方法
    public RolePermission(String roleId, String permissionId) {
        this.roleId = roleId;
        this.permissionId = permissionId;
        this.createTime = new Date();
    }

    // Getter和Setter方法
    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getRoleId() {
        return roleId;
    }

    public void setRoleId(String roleId) {
        this.roleId = roleId;
    }

    public String getPermissionId() {
        return permissionId;
    }

    public void setPermissionId(String permissionId) {
        this.permissionId = permissionId;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    // 链式setter方法
    public RolePermission setIdRP(Integer id) {
        this.id = id;
        return this;
    }

    public RolePermission setRoleIdRP(String roleId) {
        this.roleId = roleId;
        return this;
    }

    public RolePermission setPermissionIdRP(String permissionId) {
        this.permissionId = permissionId;
        return this;
    }

    public RolePermission setCreateTimeRP(Date createTime) {
        this.createTime = createTime;
        return this;
    }

    @Override
    public String toString() {
        return "RolePermission{" +
                "id=" + id +
                ", roleId='" + roleId + '\'' +
                ", permissionId='" + permissionId + '\'' +
                ", createTime=" + createTime +
                '}';
    }
}